#ifndef _DECORATORSTYPE_H_
#define _DECORATORSTYPE_H_
#include "SimpleNode.h"
#include "ast/exprType.h"
#include "ast/exprType.h"
#include "ast/keywordType.h"
#include "AstTypes.h"
class IVisitor;
class decoratorsType;
typedef QSharedPointer<decoratorsType> decoratorsTypePtr;

class decoratorsType: public SimpleNode
{
public:
    explicit decoratorsType(const exprTypePtr& func, const ExprTypeList& args, const KeywordTypeList& keywords, const exprTypePtr& starargs, const exprTypePtr& kwargs, int nodeId=-1);
    virtual ~decoratorsType();
    
    
    exprTypePtr func();
    void setFunc(const exprTypePtr& func);
    
    ExprTypeList args();
    void setArgs(const ExprTypeList& args);
    
    KeywordTypeList keywords();
    void setKeywords(const KeywordTypeList& keywords);
    
    exprTypePtr starargs();
    void setStarargs(const exprTypePtr& starargs);
    
    exprTypePtr kwargs();
    void setKwargs(const exprTypePtr& kwargs);
    
    
    virtual Ast::AstTypes type() const;
    virtual QString toString() const;
    virtual void accept(IVisitor* visitor, const SimpleNodePtr& node);
    virtual void traverse(IVisitor* visitor);
private:
    exprTypePtr _func;
    ExprTypeList _args;
    KeywordTypeList _keywords;
    exprTypePtr _starargs;
    exprTypePtr _kwargs;
};



typedef QListIterator<decoratorsTypePtr> DecoratorsTypePtrListIterator;

class DecoratorsTypeList: public QList<decoratorsTypePtr>
{
public:
    inline DecoratorsTypeList() { }
    inline explicit DecoratorsTypeList(decoratorsTypePtr i) { append(i); }
    inline DecoratorsTypeList(const DecoratorsTypeList &l) : QList<decoratorsTypePtr>(l) { }
    inline DecoratorsTypeList(const QList<decoratorsTypePtr> &l) : QList<decoratorsTypePtr>(l) { }

    inline DecoratorsTypeList operator+(const DecoratorsTypeList &other) const
    { DecoratorsTypeList n = *this; n += other; return n; }
    inline DecoratorsTypeList &operator<<(decoratorsTypePtr it)
    { append(it); return *this; }
    inline DecoratorsTypeList &operator<<(const DecoratorsTypeList &l)
    { *this += l; return *this; }

    QString toString() const
    {
        QString str("DecoratorsTypeList(");
        foreach(decoratorsTypePtr it, *this){
            if (it != NULL){
                str += it->toString()+",";
            }
        }
        str += ")";
        return str;
    }

    void traverse(IVisitor* visitor)
    {
        foreach(decoratorsTypePtr it, *this){
            if (it != NULL){
                it->accept(visitor, it);
            }
        }
    }
};



#endif